package cn.iocoder.yudao.module.asasc.dal.mysql.campaign;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.asasc.controller.admin.campaign.vo.AsaAppConfigPageReqVO;
import cn.iocoder.yudao.module.asasc.dal.dataobject.campaign.AsaAppConfigDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ASA应用配置 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AsaAppConfigMapper extends BaseMapperX<AsaAppConfigDO> {

    default PageResult<AsaAppConfigDO> selectPage(AsaAppConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AsaAppConfigDO>()
                .eqIfPresent(AsaAppConfigDO::getOrgId, reqVO.getOrgId())
                .eqIfPresent(AsaAppConfigDO::getAdamId, reqVO.getAdamId())
                .eqIfPresent(AsaAppConfigDO::getClientId, reqVO.getClientId())
                .eqIfPresent(AsaAppConfigDO::getTeamId, reqVO.getTeamId())
                .eqIfPresent(AsaAppConfigDO::getKeyId, reqVO.getKeyId())
                .eqIfPresent(AsaAppConfigDO::getPrivacyKey, reqVO.getPrivacyKey())
                .eqIfPresent(AsaAppConfigDO::getJobEnable, reqVO.getJobEnable())
                .betweenIfPresent(AsaAppConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AsaAppConfigDO::getId));
    }

}